<#if response.notOK>
<div class="modal-body">
	<div class="form-body">
		<div class="form-group">
			<div>异常数据</div>
		</div>
	</div>
</div>
<#else>
<div class="modal-body">
	<div class="row">
		<div class="col-md-12">
			<div class="form-body">
				<div class="form-group">
					<label class="control-label col-md-3"> Topic: </label>
			        <div class="col-md-5">
						<input type="text" value="${response.result.topic.name}" readonly="readonly" class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="control-label col-md-3"> 生产者组: </label>
			        <div class="col-md-5">
						<input type="text" value="${response.result.userProducer.producer}" readonly="readonly" class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="control-label col-md-3"> 删除用户: </label>
			        <div class="col-md-5">
						<#if response.result.user??>
							<input type="text" value="${response.result.user.name!response.result.user.emailName}" readonly="readonly" class="form-control" />
						<#else>
							<input type="text" value="暂无数据" readonly="readonly" class="form-control" />
						</#if>
					</div>
				</div>
				<#if response.result.userList?? && !response.result.isCommit()>
				<div class="form-group">
					<label class="control-label col-md-3"> 当前关联用户: </label>
			        <div class="col-md-5">
			        	<#if response.result.userList??>
			        		<div class="form-control-static">
				        	<#list response.result.userList as user>
				        		<#if user_index != 0>
						    		,
						    	</#if>
				        		${user.name!user.emailName}			        					        		
				        	</#list>
				        	</div>	
						<#else>
							<input type="text" value="暂无数据" readonly="readonly" class="form-control" />
						</#if>						
					</div>
				</div>
				</#if>
				<div class="form-group">
					<label class="control-label col-md-3"> 拒绝理由: </label>
					<div class="col-md-5">
						<textarea type="text" id="deleteUserProducerRefuseReason" rows="3" class="form-control" placeholder="请填写"></textarea>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="modal-footer" id="auditTopicFooter">
	<button type="button" data-dismiss="modal" class="btn" >取消</button>
	<button type="button" class="btn btn-warning" id="disAgreeDeleteUserProducerBtn" onclick="disAgreeDeleteUserProducer()">拒绝</button>
	<button type="button" class="btn btn-primary" id="agreeDeleteUserProducerBtn" onclick="agreeDeleteUserProducer()">同意</button>
</div>
<script>
function agreeDeleteUserProducer(){
	disable("agreeDeleteUserProducerBtn");
	$.post('${request.contextPath}/admin/audit/userProducer/delete',
		{
			aid: ${response.result.aid}
		},
        function(data){
            if(data.status == 200){
            	toastr.success("审核成功, 系统将自动刷新");
            	reload(3000);
		    }else{
		    	toastr.error("审核失败！"+data.message);
		    	enable("agreeDeleteUserProducerBtn");
		    }
       }, 'json');
}
function disAgreeDeleteUserProducer(){
	var refuseReason = $("#deleteUserProducerRefuseReason").val();
	if(!refuseReason){
		alert("请填写拒绝理由");
		return;
	}
	disable("disAgreeDeleteUserProducerBtn");
	$.post('${request.contextPath}/admin/audit/refuse',
		{
			aid: ${response.result.aid},
			refuseReason: refuseReason
		},
        function(data){
            if(data.status == 200){
            	toastr.success("拒绝成功, 系统将自动刷新");
            	reload(3000);
		    }else{
		    	toastr.error("拒绝失败！"+data.message);
		    	enable("disAgreeDeleteUserProducerBtn");
		    }
       }, 'json');
}
</script>
</#if>